Tenka1 Programmer Beginner Contest D - Crossing